function lanToCoord(e, t, a) {
  var x = Math.cos(e / 180 * Math.PI) * Math.cos(t / 180 * Math.PI) * a
  var y = Math.sin(t / 180 * Math.PI) * a
  var z = -Math.sin(e / 180 * Math.PI) * Math.cos(t / 180 * Math.PI) * a
  return [x, y, z]
}
function lanToVector3(e, t, a) {
  var x = Math.cos(e / 180 * Math.PI) * Math.cos(t / 180 * Math.PI) * a
  var y = Math.sin(t / 180 * Math.PI) * a
  var z = -Math.sin(e / 180 * Math.PI) * Math.cos(t / 180 * Math.PI) * a
  return new b.Vector3(x, y, z)
}

var data = [{
  label: "科技感地球",
  name: "technologyEarth"
}, {
  label: "环境光",
  name: "ambientLight"
}, {
  label: "方向光",
  name: "directionalLight"
}, {
  label: "大气层",
  name: "Atmosphere"
}, {
  label: "扫描线",
  name: "scanning"
}, {
  label: "六边形标记",
  name: "hexagonMark"
}, {
  label: "柱状图",
  name: "barCharts"
}, {
  label: "科技感云",
  name: "technologyCloud"
}, {
  label: "卫星",
  name: "satellite"
}, {
  label: "飞线",
  name: "flyLine"
}, {
  label: "点标记",
  name: "pointMark"
}, {
  label: "场景管理器",
  name: "scenarioManager"
}, {
  label: "装饰星星",
  name: "movingStars"
}, {
  name: "科技感地球",
  value: "technologyEarth"
}, {
  name: "真实地球",
  value: "simulationEarth"
}, {
  name: "环境光",
  value: "ambientLight"
}, {
  name: "方向光",
  value: "directionalLight"
}, {
  name: "大气层",
  value: "Atmosphere"
}, {
  name: "云层",
  value: "AtmoCloud"
}, {
  name: "大气层内",
  value: "AtmosphereInner"
}, {
  name: "扫描线",
  value: "scanning"
}, {
  name: "六边形标记",
  value: "hexagonMark"
}, {
  name: "柱状图",
  value: "barCharts"
}, {
  name: "科技感云",
  value: "technologyCloud"
}, {
  name: "卫星",
  value: "satellite"
}, {
  name: "飞线",
  value: "flyLine"
}, {
  name: "点标记",
  value: "pointMark"
}, {
  name: "名称标牌",
  value: "nameBubble"
}, {
  name: "场景管理器",
  value: "scenarioManager"
}, {
  name: "装饰星星",
  value: "movingStars"
}, {
  name: "表面线",
  value: "surfaceLine"
}, {
  name: "火车",
  value: "train"
}, {
  name: "区域热力",
  value: "canvasPolygon"
}, {
  name: "iframe标牌",
  value: "iframeBubble"
}]


class TechnologyEarth {
  constructor() {
    this.earthGroup = n.earthGroup
    this.config = e.configuration.technologyEarth
    var r = this.config.lineConfig;
    this.showGroup = new b.Group
    this.earthGroup.add(this.showGroup)
    this.height = n.height
    this.devicePixelRatio = n.devicePixelRatio ? n.devicePixelRatio : 1
    this.vertexShader = "\n      uniform float size;\n      uniform float scale;\n      varying float opacity;\n\n      void main() {\n        vec4 mPosition = modelMatrix * vec4( position, 1.0 );\n        vec4 mvPosition = viewMatrix * mPosition;\n        vec4 mZeroPositon = modelMatrix * vec4(.0, .0, .0, 1.0);\n\n        vec3 positionToZero = mPosition.xyz - mZeroPositon.xyz;\n\n        vec3 vToEye = cameraPosition - mPosition.xyz;\n        opacity = dot(vToEye, positionToZero);\n        gl_PointSize = size * ( scale / -mvPosition.z );\n        gl_Position = projectionMatrix * mvPosition;\n      }"
    this.fragmentShader = "uniform vec3 color;\n      uniform sampler2D pointTexture;\n      varying float opacity;\n\n      void main() {\n        if(opacity <= 0.0) {\n          gl_FragColor = vec4(color, 0.05);\n        } else {\n          gl_FragColor = vec4(color, 1.0);\n        }\n        \n        gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord );\n      }"
    this.initPointsMaterial()
    this.showPoints()
    if (r.show) {
      this.initBorderMaterial()
      this.showBorder()
    }
  }
  showPoints() {
    var t = this.config.defaultConfig
    var a = document.createElement("img")
    a.setAttribute("crossOrigin", "anonymous")
    a.src = window.appConfig.ASSETS_URL + t.mapImage
    a.onload = function () {
      var t = document.createElement("canvas")
      var n = t.getContext("2d")
      t.width = a.width
      t.height = a.height
      n.drawImage(a, 0, 0, a.width, a.height)
      this.earthImgData = n.getImageData(0, 0, a.width, a.height)
      this.createEarthParticles(this.earthImgData, a.width, a.height)
    }
  }
  showBorder() {
    var sphere = new b.SphereGeometry(1e3, 128, 128)
    this.border = new b.Mesh(sphere, this.borderMaterial)
    this.showGroup.add(this.border)
  }
  initPointsMaterial() {
    this.textureLoader || (this.textureLoader = new b.TextureLoader);
    var e = this.config
    var t = e.pointConfig
    var a = e.defaultConfig
    this.pointsMaterial = new b.ShaderMaterial({
      uniforms: {
        scale: {
          value: this.height / 2 * this.devicePixelRatio
        },
        color: {
          value: (new b.Color).setStyle(t.color.toLocaleLowerCase())
        },
        pointTexture: {
          value: this.textureLoader.load(window.appConfig.ASSETS_URL + a.pointImage)
        },
        size: {
          value: t.size
        },
        radius: {
          value: 1e3
        }
      },
      transparent: !0,
      depthTest: !1,
      blending: b.AdditiveBlending,
      vertexShader: this.vertexShader,
      fragmentShader: this.fragmentShader,
      alphaTest: .8
    })
  }
  initBorderMaterial() {
    this.textureLoader || (this.textureLoader = new b.TextureLoader);
    var e = this.config.defaultConfig
    var t = this.config.lineConfig
    this.borderMaterial = new b.MeshBasicMaterial({
      color: (new b.Color).setStyle(t.color.toLocaleLowerCase()),
      map: this.textureLoader.load(window.appConfig.ASSETS_URL + e.borderImage),
      transparent: !0,
      blending: b.AdditiveBlending,
      depthTest: !1,
      opacity: t.opacity
    })
  }
  createEarthParticles(e, t, a) {
    var n = this.config.pointConfig
    var i = []
    var r = new b.Spherical
    r.radius = 1e3
    var o = n.count
    for (var s = 0; s < o; s++) {
      var l = new b.Vector3
      var u = 1 / Math.cos(Math.abs(s - o / 2) / o * Math.PI)
      for (var c = 0; c < o; c += u) {
        var h = c / o
        var p = s / o
        Math.floor(2 * Math.random());
        if (this.isLandByUV(h, p, e, t, a)) {
          r.theta = h * Math.PI * 2 - Math.PI / 2
          r.phi = p * Math.PI
          l.setFromSpherical(r)
          i.push(l.x)
          i.push(l.y)
          i.push(l.z)
        }
      }
      l = null
    }
    var d = new b.BufferGeometry;
    d.addAttribute("position", new b.Float32BufferAttribute(i, 3))
    d.computeBoundingSphere()
    this.points = new b.Points(d, this.pointsMaterial)
    this.points.renderOrder = 3
    this.showGroup.add(this.points)
    i = null
  }
  isLandByUV(e, t, a, n, i) {
    a || console.error("data error!")
    var r = parseInt(n * e)
    var o = parseInt(i * t)
    return 100 < a.data[4 * (o * a.width + r)]
  }
  updateComponent(e) {
    var t = this.config
    var a = t.pointConfig
    var n = t.lineConfig
    this.config = e.configuration.technologyEarth
    var i = this.config
    var r = i.pointConfig
    var o = i.lineConfig
    if (r.size === a.size && r.color === a.color) {
      this.pointsMaterial.uniforms.size.value = r.size
      this.pointsMaterial.uniforms.color.value = new b.Color(r.color.toLocaleLowerCase())
    }
    if (o.color === n.color && o.opacity === n.opacity) {
      this.borderMaterial.color = new b.Color(o.color.toLocaleLowerCase())
      this.borderMaterial.opacity = o.opacity
    }
    if (r.count !== a.count) {
      this.showGroup.remove(this.points)
      this.points.geometry.dispose()
      this.showPoints()
      this.points = null
    }
    if (o.show !== n.show) {
      this.destroyBorder()
      this.initBorderMaterial()
      this.showBorder()
    }
  }
  destroyPoints() {
    this.points && this.points.geometry && this.points.geometry.dispose()
    this.pointsMaterial && this.pointsMaterial.map && this.pointsMaterial.map.dispose()
    this.pointsMaterial && this.pointsMaterial.dispose()
    this.showGroup.remove(this.points)
    this.pointsMaterial && (this.pointsMaterial.map = null)
    this.pointsMaterial = null
    this.points = null
  },
  destroyBorder() {
    this.border && this.border.geometry && this.border.geometry.dispose()
    this.borderMaterial && this.borderMaterial.map && this.borderMaterial.map.dispose()
    this.borderMaterial && this.borderMaterial.dispose()
    this.showGroup.remove(this.border)
    this.borderMaterial && (this.borderMaterial.map = null)
    this.borderMaterial = null
    this.border = null
  }
  destroy() {
    this.textureLoader = null
    this.earthImgData = null
    this.destroyPoints()
    this.destroyBorder()
    this.earthGroup.remove(this.showGroup)
    this.showGroup = null
  }
}

class Atmosphere {
  constructor(e, n) {
    this.config = e.configuration.Atmosphere
    this.otherGroup = n.otherGroup
    this.showGroup = new b.Group
    this.otherGroup.add(i.showGroup)
    this.inRadius = 1e3 + i.config.baseConfig.height
    this.initMaterial()
    this.showData()
  }

  initMaterial() {
    var e = ["varying vec3 vVertexWorldPosition;", "varying vec3 vVertexNormal;", "varying vec4 vFragColor;", "void main(){", " vVertexNormal = normalize(normalMatrix * normal);", " vVertexWorldPosition  = (modelMatrix * vec4(position, 1.0)).xyz;", " // set gl_Position", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", "}"].join("\n")
    var t = ["uniform vec3 glowColor;", "uniform float  opacity;", "uniform float  division;", "uniform float  coeficient;", "uniform float  power;", "uniform float  scale;", "varying vec3 vVertexNormal;", "varying vec3 vVertexWorldPosition;", "varying vec4 vFragColor;", "void main(){", " vec3 worldVertexToCamera= cameraPosition - vVertexWorldPosition;", " vec3 viewCameraToVertex = (viewMatrix * vec4(worldVertexToCamera, 0.0)).xyz;", " viewCameraToVertex  = normalize(viewCameraToVertex);", " float intensity   = coeficient + dot(vVertexNormal, viewCameraToVertex);", " if(intensity > division){ discard;}", " intensity = intensity / division * scale;", " intensity = pow(intensity, power);", " gl_FragColor = vec4(glowColor, opacity*intensity);", "}"].join("\n")
    var a = (new b.Color).setStyle(this.config.baseConfig.color.toLocaleLowerCase())
    var n = Object(T.rgb)(this.config.baseConfig.color).opacity;
    this.material_glow_out = new b.ShaderMaterial({
      uniforms: {
        division: {
          type: "f",
          value: Math.sqrt(this.inRadius * this.inRadius - 1e6) / this.inRadius
        },
        coeficient: {
          type: "f",
          value: -1e-4
        },
        power: {
          type: "f",
          value: 5
        },
        scale: {
          type: "f",
          value: .85
        },
        glowColor: {
          type: "c",
          value: a
        },
        opacity: {
          type: "f",
          value: n
        }
      },
      vertexShader: e,
      fragmentShader: t,
      blending: b.NormalBlending,
      transparent: !0,
      depthWrite: !1
    }),
      this.material_glow = new b.ShaderMaterial({
        uniforms: {
          division: {
            type: "f",
            value: Math.sqrt(this.inRadius * this.inRadius - 1e6) / this.inRadius
          },
          coeficient: {
            type: "f",
            value: -1e-4
          },
          power: {
            type: "f",
            value: 25
          },
          scale: {
            type: "f",
            value: 1
          },
          glowColor: {
            type: "c",
            value: a
          },
          opacity: {
            type: "f",
            value: n
          }
        },
        vertexShader: e,
        fragmentShader: t,
        blending: b.NormalBlending,
        transparent: !0,
        depthWrite: !1
      })
  }
  showData() {
    var e = new b.SphereGeometry(this.inRadius, 64, 64)
    var t = new b.Mesh(e, this.material_glow_out);
    this.showGroup.add(t);
    var a = new b.Mesh(e, this.material_glow);
    this.showGroup.add(a)
  }
  updateComponent(e) {
    var t = this.config;
    this.config = e.configuration.Atmosphere
    if (t.baseConfig.height !== this.config.baseConfig.height) {
      this.inRadius = 1e3 + this.config.baseConfig.height
      this.clearAll()
      this.initMaterial()
      this.showData()
    } else if (t.baseConfig.color !== this.config.baseConfig.color) {
      var a = new b.Color(this.config.baseConfig.color.toLocaleLowerCase());
      if (this.material_glow_out) {
        this.material_glow_out.uniforms.glowColor.value = a
        this.material_glow_out.uniforms.opacity.value = Object(T.rgb)(this.config.baseConfig.color).opacity
      }
      if (this.material_glow) {
        this.material_glow.uniforms.glowColor.value = a
        this.material_glow_out.uniforms.opacity.value = Object(T.rgb)(this.config.baseConfig.color).opacity
      }
    }
  }
  clearAll() {
    this.destroy()
    this.showGroup = new b.Group
    this.otherGroup.add(this.showGroup)
  }
  destroy() {
    this.otherGroup.remove(this.showGroup)
    Object(S.deepDispose)(this.showGroup)
    this.showGroup = null
    this.material_glow_out = null
    this.material_glow = null
  }
}

class AtmosphereInner {
  constructor(e, n) {
    this.config = e.configuration.AtmosphereInner
    i.otherGroup = n.otherGroup
    i.showGroup = new b.Group
    i.otherGroup.add(i.showGroup)
    i.inRadius = 1e3 + i.config.baseConfig.height
    i.initMaterial()
    i.showData()
  }
  initMaterial() {
    var e = ["varying vec3 vVertexWorldPosition;", "varying vec3 vVertexNormal;", "varying vec4 vFragColor;", "void main(){", " vVertexNormal = normalize(normalMatrix * normal);", " vVertexWorldPosition  = (modelMatrix * vec4(position, 1.0)).xyz;", " // set gl_Position", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", "}"].join("\n"),
      t = ["uniform vec3 glowColor;", "uniform float  division;", "uniform float  coeficient;", "uniform float  opacity;", "uniform float  power;", "uniform float  scale;", "varying vec3 vVertexNormal;", "varying vec3 vVertexWorldPosition;", "varying vec4 vFragColor;", "void main(){", " vec3 worldVertexToCamera= cameraPosition - vVertexWorldPosition;", " vec3 viewCameraToVertex = (viewMatrix * vec4(worldVertexToCamera, 0.0)).xyz;", " viewCameraToVertex  = normalize(viewCameraToVertex);", " float intensity   = coeficient + dot(vVertexNormal, viewCameraToVertex);", " if(intensity < division){ discard;}", " intensity = intensity / division * scale;", " intensity = pow(intensity, power);", " gl_FragColor = vec4(glowColor, opacity*(1.0 - intensity));", "}"].join("\n"),
      a = (new b.Color).setStyle(this.config.baseConfig.color.toLocaleLowerCase()),
      n = Object(T.rgb)(this.config.baseConfig.color).opacity;
    this.material_glow_out = new b.ShaderMaterial({
      uniforms: {
        division: {
          type: "f",
          value: Math.sqrt(this.inRadius * this.inRadius - 1e6) / this.inRadius
        },
        coeficient: {
          type: "f",
          value: 1e-4
        },
        power: {
          type: "f",
          value: 5
        },
        scale: {
          type: "f",
          value: .85
        },
        glowColor: {
          type: "c",
          value: a
        },
        opacity: {
          type: "f",
          value: n
        }
      },
      vertexShader: e,
      fragmentShader: t,
      blending: b.NormalBlending,
      transparent: !0,
      depthWrite: !1,
      depthTest: !1
    }),
      this.material_glow = new b.ShaderMaterial({
        uniforms: {
          division: {
            type: "f",
            value: Math.sqrt(this.inRadius * this.inRadius - 1e6) / this.inRadius
          },
          coeficient: {
            type: "f",
            value: 1e-4
          },
          power: {
            type: "f",
            value: 25
          },
          scale: {
            type: "f",
            value: 1
          },
          glowColor: {
            type: "c",
            value: a
          },
          opacity: {
            type: "f",
            value: n
          }
        },
        vertexShader: e,
        fragmentShader: t,
        blending: b.NormalBlending,
        transparent: !0,
        depthWrite: !1,
        depthTest: !1
      })

  }
  showData() {
    var e = new b.SphereGeometry(this.inRadius, 64, 64)
    var t = new b.Mesh(e, this.material_glow_out);
    t.renderOrder = 1
    this.showGroup.add(t);
    var a = new b.Mesh(e, this.material_glow);
    a.renderOrder = 1
    this.showGroup.add(a)
  }
  updateComponent(e) {
    var t = this.config;
    if (this.config = e.configuration.AtmosphereInner,
      t.baseConfig.height !== this.config.baseConfig.height)
      this.inRadius = 1e3 + this.config.baseConfig.height,
        this.clearAll(),
        this.initMaterial(),
        this.showData();
    else if (t.baseConfig.color !== this.config.baseConfig.color) {
      var a = (new b.Color).setStyle(this.config.baseConfig.color.toLocaleLowerCase());
      this.material_glow_out && (this.material_glow_out.uniforms.glowColor.value = a,
        this.material_glow_out.uniforms.opacity.value = Object(T.rgb)(this.config.baseConfig.color).opacity),
        this.material_glow && (this.material_glow.uniforms.glowColor.value = a,
          this.material_glow_out.uniforms.opacity.value = Object(T.rgb)(this.config.baseConfig.color).opacity)
    }
  }
  clearAll() {
    this.destroy()
    this.showGroup = new b.Group
    this.otherGroup.add(this.showGroup)
  }
  destroy() {
    this.otherGroup.remove(this.showGroup)
    Object(S.deepDispose)(this.showGroup)
    this.showGroup = null
    this.material_glow_out = null
    this.material_glow = null
  }
}

class ScanningLight {
  constructor(e, n) {
    this.earthGroup = n.earthGroup
    i.config = e.configuration.scanning
    i.showGroup = new b.Group
    i.earthGroup.add(i.showGroup)
    i.initMaterial()
    i.showData()
  }
  initMaterial() {
    var e = this.config.baseConfig;
    this.scaneTexture && this.scaneTexture.dispose(),
      this.scaneMaterial && this.scaneMaterial.dispose();
    var t = ["varying vec2 vUv;", "void main(){", " vUv = uv;", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", "}"].join("\n"),
      a = ["varying vec2 vUv;", "uniform float time;", "uniform vec3 color;", "uniform float opacity;", "uniform sampler2D scaneTexture;", "void main(){", " vec4 textureColor = texture2D(scaneTexture, vec2(vUv.x, vUv.y + time));", " gl_FragColor = vec4( vec3(textureColor) * color, textureColor.a * opacity);", "}"].join("\n"),
      n = document.createElement("canvas");
    n.style.position = "absolute",
      n.style.top = "0px",
      n.width = 1024,
      n.height = 1024;
    for (var i = n.getContext("2d"), r = 10; r > 0; r--)
      i.beginPath(),
        i.rect(0, 4 * (10 - r), 1024, 2),
        i.fillStyle = "rgba(255, 255, 255, ".concat(r / 10, ")"),
        i.fill();
    this.scaneTexture = new b.Texture(n),
      this.scaneTexture.wrapT = b.RepeatWrapping,
      this.scaneTexture.wrapS = b.RepeatWrapping,
      this.scaneTexture.needsUpdate = !0,
      this.scaneMaterial = new b.ShaderMaterial({
        uniforms: {
          time: {
            type: "f",
            value: 0
          },
          color: {
            type: "c",
            value: (new b.Color).setStyle(e.color.toLocaleLowerCase())
          },
          scaneTexture: {
            value: this.scaneTexture
          },
          opacity: {
            type: "f",
            value: e.opacity
          }
        },
        vertexShader: t,
        fragmentShader: a,
        transparent: !0,
        depthTest: !1,
        blending: b.AdditiveBlending
      })
  }
  showData() {
    this.scaneMesh = new b.Mesh(new b.SphereGeometry(1005, 128, 128), this.scaneMaterial)
    this.scaneMesh.renderOrder = 20;
    var e = this.config.baseConfig;
    this.scaneMesh.setRotationFromEuler(new b.Euler(0, e.center.lng / 180 * Math.PI, (e.center.lat - 90) / 180 * Math.PI, "XYZ")),
      this.showGroup.add(this.scaneMesh)
  }
  updateComponent(e) {
    var t = this.config.baseConfig;
    this.config = e.configuration.scanning;
    var a = this.config.baseConfig;
    t.color !== a.color && (this.scaneMaterial.uniforms.color.value = (new b.Color).setStyle(a.color.toLocaleLowerCase())),
      t.opacity !== a.opacity && (this.scaneMaterial.uniforms.opacity.value = a.opacity),
      a.center.lng !== t.center.lng || (a.center.lat,
        t.center.lat),
      this.scaneMesh.setRotationFromEuler(new b.Euler(0, a.center.lng / 180 * Math.PI, (a.center.lat - 90) / 180 * Math.PI, "XYZ"))
  }

  update() {
    var e = this.config.baseConfig;
    this.scaneMaterial && (this.scaneMaterial.uniforms.time.value = (this.scaneMaterial.uniforms.time.value - 5e-4 * e.speed) % 1)
  }
  destroy() {
    this.scaneTexture && this.scaneTexture.dispose()
    this.scaneMaterial && this.scaneMaterial.dispose()
    this.scaneMesh && this.scaneMesh.geometry.dispose()
    this.showGroup.remove(this.scaneMesh)
    this.earthGroup.remove(this.showGroup)
    this.scaneTexture = null
    this.scaneMaterial = null
    this.scaneMesh = null
  }
}

class SimulationEarth {
  constructor(e, n) {
    this.earthGroup = n.earthGroup
    i.config = e.configuration.simulationEarth
    i.showGroup = new b.Group
    i.earthGroup.add(i.showGroup)
    i.initMaterial()
    i.showData()
  }

  initMaterial() {
    this.textureLoader || (this.textureLoader = new b.TextureLoader);
    var e = this.config,
      t = e.baseConfig,
      a = e.normalConfig,
      n = e.heightConfig,
      i = e.roughnessConfig,
      r = e.emissiveConfig;
    this.earthMaterial = new b.MeshPhysicalMaterial({
      opacity: t.opacity,
      color: (new b.Color).setStyle(t.color.toLocaleLowerCase()),
      transparent: !0
    }),
      t.texture && (this.earthMaterial.map = this.textureLoader.load(window.appConfig.ASSETS_URL + t.texture)),
      a.support && a.texture && (this.earthMaterial.normalMap = this.textureLoader.load(window.appConfig.ASSETS_URL + a.texture),
        this.earthMaterial.normalScale = new b.Vector2(a.strong, a.strong)),
      n.support && n.texture && (this.earthMaterial.displacementMap = this.textureLoader.load(window.appConfig.ASSETS_URL + n.texture),
        this.earthMaterial.displacementScale = n.strong),
      i.support && i.texture && (this.earthMaterial.metalnessMap = this.textureLoader.load(window.appConfig.ASSETS_URL + i.texture),
        this.earthMaterial.roughness = 1 - i.strong,
        this.earthMaterial.metalness = i.strong),
      r.support && r.texture && (this.earthMaterial.emissiveMap = this.textureLoader.load(window.appConfig.ASSETS_URL + r.texture),
        this.earthMaterial.emissive = (new b.Color).setStyle(r.color.toLocaleLowerCase()),
        this.earthMaterial.emissiveIntensity = r.strong),
      this.earthMaterial.needsUpdate = !0
  }
  showData() {
    this.earth = new b.Mesh(new b.SphereGeometry(1e3, 128, 128), this.earthMaterial),
      this.showGroup.add(this.earth)
  }
  updateComponent(e) {
    var t = this.config,
      a = t.baseConfig,
      n = t.normalConfig,
      i = t.heightConfig,
      r = t.roughnessConfig,
      o = t.emissiveConfig;
    this.config = e.configuration.simulationEarth;
    var s = this.config,
      l = s.baseConfig,
      u = s.normalConfig,
      c = s.heightConfig,
      h = s.roughnessConfig,
      p = s.emissiveConfig;
    Object(w.isEqual)(a, l) || (this.earthMaterial.opacity = l.opacity,
      a.texture !== l.texture && (this.earthMaterial && this.earthMaterial.map && (this.earthMaterial.map.dispose(),
        this.earthMaterial.map = null),
        this.earthMaterial.map = this.textureLoader.load(window.appConfig.ASSETS_URL + l.texture),
        this.earthMaterial.needsUpdate = !0),
      this.earthMaterial.opacity = l.opacity,
      this.earthMaterial.color = (new b.Color).setStyle(l.color.toLocaleLowerCase())),
      Object(w.isEqual)(n, u) || (n.support && !u.support ? this.earthMaterial && this.earthMaterial.normalMap && (this.earthMaterial.normalMap.dispose(),
        this.earthMaterial.normalMap = null,
        this.earthMaterial.needsUpdate = !0) : !n.support && u.support && (this.earthMaterial.normalMap = this.textureLoader.load(window.appConfig.ASSETS_URL + u.texture),
          this.earthMaterial.needsUpdate = !0),
        this.earthMaterial.normalScale = new b.Vector2(u.strong, u.strong)),
      Object(w.isEqual)(i, c) || (i.support && !c.support ? this.earthMaterial && this.earthMaterial.displacementMap && (this.earthMaterial.displacementMap.dispose(),
        this.earthMaterial.displacementMap = null,
        this.earthMaterial.needsUpdate = !0) : !i.support && c.support && (this.earthMaterial.displacementMap = this.textureLoader.load(window.appConfig.ASSETS_URL + c.texture),
          this.earthMaterial.needsUpdate = !0),
        this.earthMaterial.displacementScale = c.strong),
      Object(w.isEqual)(r, h) || (r.support && !h.support ? this.earthMaterial && this.earthMaterial.metalnessMap && (this.earthMaterial.metalnessMap.dispose(),
        this.earthMaterial.metalnessMap = null,
        this.earthMaterial.needsUpdate = !0) : !r.support && h.support && (this.earthMaterial.metalnessMap = this.textureLoader.load(window.appConfig.ASSETS_URL + h.texture),
          this.earthMaterial.needsUpdate = !0),
        this.earthMaterial.roughness = 1 - h.strong,
        this.earthMaterial.metalness = h.strong),
      Object(w.isEqual)(o, p) || (o.support && !p.support ? (this.earthMaterial && this.earthMaterial.emissiveMap && this.earthMaterial.emissiveMap.dispose && (this.earthMaterial.emissiveMap.dispose(),
        this.earthMaterial.emissiveMap = null,
        this.earthMaterial.needsUpdate = !0),
        this.earthMaterial.emissiveIntensity = 1,
        this.earthMaterial.emissive = new b.Color(0)) : p.support && (o.support && o.texture === p.texture || (this.earthMaterial.emissiveMap = this.textureLoader.load(window.appConfig.ASSETS_URL + p.texture),
          this.earthMaterial.needsUpdate = !0),
          this.earthMaterial.emissive = (new b.Color).setStyle(p.color.toLocaleLowerCase()),
          this.earthMaterial.emissiveIntensity = p.strong))
  }
  destroy() {
    this.earthMaterial && (this.earthMaterial.dispose(),
      this.earthMaterial = null),
      this.earthMaterial && this.earthMaterial.map && (this.earthMaterial.map.dispose(),
        this.earthMaterial.map = null),
      this.earthMaterial && this.earthMaterial.normalMap && (this.earthMaterial.normalMap.dispose(),
        this.earthMaterial.normalMap = null),
      this.earthMaterial && this.earthMaterial.displacementMap && (this.earthMaterial.displacementMap.dispose(),
        this.earthMaterial.displacementMap = null),
      this.earthMaterial && this.earthMaterial.metalnessMap && (this.earthMaterial.metalnessMap.dispose(),
        this.earthMaterial.metalnessMap = null),
      this.earthMaterial && this.earthMaterial.emissiveMap && (this.earthMaterial.emissiveMap.dispose(),
        this.earthMaterial.emissiveMap = null),
      this.earth && this.earth.geometry && (this.earth.geometry.dispose(),
        this.earth.geometry = null),
      this.earth = null,
      this.showGroup.remove(this.earth),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null
  }
}

class HexagonMark {
  constructor(e, n) {
    this.config = e.configuration.hexagonMark
    i.data = e.data
    i.width = n.width
    i.height = n.height
    i.earthGroup = n.earthGroup
    i.showGroup = new b.Group
    i.outerGroup = new b.Group
    i.showGroup.add(i.outerGroup)
    i.innerGroup = new b.Group
    i.showGroup.add(i.innerGroup)
    i.earthGroup.add(i.showGroup)
    i.initInnerMaterial()
    i.showDataInner()
    i.initOuterMaterial()
    i.showDataOuter()
  }
  initOuterMaterial() {
    var e = this.config.outerConfig;
    this.outerMatLine = new b.LineMaterial({
      color: (new b.Color).setStyle(e.color.toLocaleLowerCase()),
      transparent: !!e.opacity,
      linewidth: e.width,
      dashed: !1
    }),
      this.outerMatLine.uniforms.opacity.value = e.opacity
  }
  initInnerMaterial() {
    var e = this.config.innerConfig;
    e.show && (this.innerMatLine = new b.LineMaterial({
      color: (new b.Color).setStyle(e.color.toLocaleLowerCase()),
      transparent: !!e.opacity,
      linewidth: e.width,
      dashed: !1
    }),
      this.innerMatLine.uniforms.opacity.value = e.opacity)
  }
  showDataInner() {
    var e = this.config.innerConfig;
    if (e.show) {
      var t, a = r(this.data);
      try {
        for (a.s(); !(t = a.n()).done;) {
          var n = t.value,
            i = L(n.lng, n.lat, 1e3),
            o = new b.CircleGeometry(e.radius, 6);
          o.vertices.shift();
          var s, l = [],
            u = r(o.vertices);
          try {
            for (u.s(); !(s = u.n()).done;) {
              var c = s.value;
              l.push(c.x),
                l.push(c.y),
                l.push(c.z)
            }
          } catch (e) {
            u.e(e)
          } finally {
            u.f()
          }
          l.push(o.vertices[0].x),
            l.push(o.vertices[0].y),
            l.push(o.vertices[0].z);
          var h = new b.Line2((new b.LineGeometry).setPositions(l), this.innerMatLine);
          h.userData = {
            type: "inner"
          },
            h.position.copy(new b.Vector3(i[0], i[1], i[2])),
            h.lookAt(new b.Vector3(0, 0, 0)),
            this.innerGroup.add(h)
        }
      } catch (e) {
        a.e(e)
      } finally {
        a.f()
      }
    }
  }
  showDataOuter() {
    var e, t = this.config,
      a = t.outerConfig,
      n = (t.innerConfig,
        r(this.data));
    try {
      for (n.s(); !(e = n.n()).done;) {
        var i = e.value,
          o = L(i.lng, i.lat, 1e3),
          s = new b.CircleGeometry(a.radius, 6);
        s.vertices.shift();
        var l, u = [],
          c = r(s.vertices);
        try {
          for (c.s(); !(l = c.n()).done;) {
            var h = l.value;
            u.push(h.x),
              u.push(h.y),
              u.push(h.z)
          }
        } catch (e) {
          c.e(e)
        } finally {
          c.f()
        }
        u.push(s.vertices[0].x),
          u.push(s.vertices[0].y),
          u.push(s.vertices[0].z);
        var p = new b.Line2((new b.LineGeometry).setPositions(u), this.outerMatLine);
        p.userData = {
          type: "outer"
        },
          p.position.copy(new b.Vector3(o[0], o[1], o[2])),
          p.lookAt(new b.Vector3(0, 0, 0)),
          this.outerGroup.add(p)
      }
    } catch (e) {
      n.e(e)
    } finally {
      n.f()
    }
  }
  updateComponent(e) {
    var t = this.config,
      a = this.data;
    this.config = e.configuration.hexagonMark,
      this.data = e.data;
    var n = this.config,
      i = n.outerConfig,
      r = n.innerConfig;
    !Object(w.isEqual)(i, t.outerConfig) && this.outerMatLine && (this.outerMatLine.color = (new b.Color).setStyle(i.color.toLocaleLowerCase()),
      this.outerMatLine.linewidth = i.width,
      this.outerMatLine.transparent = !!i.opacity,
      this.outerMatLine.uniforms.opacity.value = i.opacity,
      i.radius !== t.outerConfig.radius && (this.destroyOuter(),
        this.showDataOuter())),
      t.innerConfig.show && !r.show ? (this.destroyInner(),
        this.innerMatLine.dispose(),
        this.innerMatLine = null) : !t.innerConfig.show && r.show ? (this.initInnerMaterial(),
          this.showDataInner()) : t.innerConfig.show && r.show && (Object(w.isEqual)(t.innerConfig, r) || (this.innerMatLine.color = (new b.Color).setStyle(r.color.toLocaleLowerCase()),
            this.innerMatLine.linewidth = r.width,
            this.innerMatLine.transparent = !!r.opacity,
            this.innerMatLine.uniforms.opacity.value = r.opacity,
            r.radius !== t.innerConfig.radius && (this.destroyInner(),
              this.showDataInner()))),
      Object(w.isEqual)(this.data, a) || (this.destroyInner(),
        this.destroyOuter(),
        this.showDataInner(),
        this.showDataOuter())
  }
  update() {
    this.outerMatLine && this.outerMatLine.resolution.set(this.width, this.height),
      this.innerMatLine && this.innerMatLine.resolution.set(this.width, this.height)
  }
  destroyOuter() {
    this.outerGroup && (this.outerGroup.traverse((function (e) {
      "outer" === e.userData.type && e.geometry && (e.geometry.dispose(),
        e.geometry = null)
    })),
      this.outerGroup.children.length = 0,
      this.outerGroup.children = [])
  }
  destroyInner() {
    this.innerGroup && (this.innerGroup.traverse((function (e) {
      "inner" === e.userData.type && e.geometry && (e.geometry.dispose(),
        e.geometry = null)
    })),
      this.innerGroup.children.length = 0,
      this.innerGroup.children = [])
  }
  destroy() {
    this.destroyOuter(),
      this.destroyInner(),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null,
      this.innerGroup = null,
      this.outerGroup = null,
      this.innerMatLine && this.outerMatLine.dispose(),
      this.outerMatLine = null,
      this.innerMatLine && this.innerMatLine.dispose(),
      this.innerMatLine = null
  }
}

class barCharts {
  constructor(e, n) {
    this.config = e.configuration.barCharts
    i.data = e.data
    i.earthGroup = n.earthGroup
    i.showGroup = new b.Group
    i.earthGroup.add(i.showGroup)
    i.initMaterial()
    i.showData()
  }
  initMaterial() {
    var e = this.config,
      t = (e.sizeConfig,
        e.colorConfig),
      a = ["#include <logdepthbuf_pars_vertex>", "varying vec2 vUv;", "void main() {", " vUv = uv;", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", " #include <logdepthbuf_vertex>", "}"].join("\n"),
      n = ["#include <logdepthbuf_pars_fragment>", "uniform vec3 bottomColor;", "uniform vec3 topColor;", "uniform float bottomOpacity;", "uniform float topOpacity;", "varying vec2 vUv;", "void main() {", " #include <logdepthbuf_fragment>", " gl_FragColor = vec4(mix(bottomColor, topColor, vUv.y), mix(bottomOpacity, topOpacity, vUv.y));", "}"].join("\n");
    this.barMaterial = new b.ShaderMaterial({
      uniforms: {
        bottomColor: {
          type: "c",
          value: (new b.Color).setStyle(t.bottomColor.toLocaleLowerCase())
        },
        topColor: {
          type: "c",
          value: (new b.Color).setStyle(t.topColor.toLocaleLowerCase())
        },
        bottomOpacity: {
          type: "f",
          value: t.bottomOpacity
        },
        topOpacity: {
          type: "f",
          value: t.topOpacity
        }
      },
      vertexShader: a,
      fragmentShader: n,
      transparent: !0,
      depthTest: !1,
      side: b.DoubleSide
    })
  }
  showData() {
    var e, t = this.config,
      a = t.sizeConfig,
      n = (t.colorConfig,
        Object(T.max)(this.data, (function (e) {
          return e.value
        }))),
      i = r(this.data);
    try {
      for (i.s(); !(e = i.n()).done;) {
        var o = e.value,
          s = o.value / n * a.maxHeight,
          l = new b.CylinderBufferGeometry(a.topRadius, a.bottomRadius, s, 16),
          u = new b.Mesh(l, [this.barMaterial, null]),
          c = new b.Group;
        c.userData = {
          type: "barGroup"
        };
        var h = L(o.lng, o.lat, 1005);
        u.position.z = -s / 2,
          u.rotateX(-.5 * Math.PI),
          c.position.x = h[0],
          c.position.y = h[1],
          c.position.z = h[2],
          c.add(u),
          c.lookAt(new b.Vector3(0, 0, 0)),
          this.showGroup.add(c)
      }
    } catch (e) {
      i.e(e)
    } finally {
      i.f()
    }
  }
  updateComponent(e) {
    var t = this.config,
      a = this.data;
    this.config = e.configuration.barCharts,
      this.data = e.data;
    var n = this.config,
      i = n.sizeConfig,
      r = n.colorConfig;
    Object(w.isEqual)(r, t.colorConfig) || (this.barMaterial.uniforms.bottomColor.value = (new b.Color).setStyle(r.bottomColor.toLocaleLowerCase()),
      this.barMaterial.uniforms.topColor.value = (new b.Color).setStyle(r.topColor.toLocaleLowerCase()),
      this.barMaterial.uniforms.bottomOpacity.value = r.bottomOpacity,
      this.barMaterial.uniforms.topOpacity.value = r.topOpacity),
      Object(w.isEqual)(i, t.sizeConfig) && Object(w.isEqual)(this.data, a) || (this.destroyGeometry(),
        this.showData())
  }
  destroyGeometry() {
    this.showGroup && this.showGroup.traverse((function (e) {
      "barGroup" === e.userData.type && e.children[0] && e.children[0].geometry && (e.children[0].geometry.dispose(),
        e.remove(e.children[0]))
    })),
      this.showGroup.children = []
  }
  destroy() {
    this.destroyGeometry(),
      this.barMaterial && (this.barMaterial.dispose(),
        this.barMaterial = null),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null
  }
}

class technologyCloud {
  constructor(e, n) {
    this.otherGroup = n.otherGroup
    i.config = e.configuration.technologyCloud
    i.showGroup = new b.Group
    i.otherGroup.add(i.showGroup)
    i.initMaterial()
    i.showData()
    i
  }
  initMaterial() {
    var e = ["varying vec2 vUv;", "varying vec3 vVertexWorldPosition;", "varying vec3 vVertexNormal;", "void main(){", " vUv = uv;", " vVertexNormal = normalize(normalMatrix * normal);", " vVertexWorldPosition  = (modelMatrix * vec4(position, 1.0)).xyz;", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", "}"].join("\n"),
      t = ["uniform vec3 color;", "varying vec2 vUv;", "varying vec3 vVertexNormal;", "varying vec3 vVertexWorldPosition;", "uniform sampler2D cloudTexture;", "uniform float  division;", "uniform float  coeficient;", "uniform float  time;", "uniform float  opacity;", "uniform float  xSpeed;", "uniform float  ySpeed;", "uniform float  number;", "void main(){", " float uvY = (vUv.y + time * 0.001 * ySpeed) * number;", " float uvYF = floor(uvY);", " bool show = false;", " if( uvY - uvYF < 0.9 ) {", "  show = true;", " }", " vec3 worldVertexToCamera= cameraPosition - vVertexWorldPosition;", " vec3 viewCameraToVertex = (viewMatrix * vec4(worldVertexToCamera, 0.0)).xyz;", " viewCameraToVertex  = normalize(viewCameraToVertex);", " float intensity   = coeficient + dot(vVertexNormal, viewCameraToVertex);", " if(intensity > division){ discard;}", " intensity = 1.0 - intensity / division;", " if(show) {", "  float offset = 1.0 - abs(uvY - uvYF - 0.45) / 1.2;", "  gl_FragColor = vec4(vec3(texture2D(cloudTexture, vec2(vUv.x + time * 0.002 * xSpeed, vUv.y) )) * vec3(color), pow(offset, 3.0) * intensity * opacity);", " } else {", "  discard;", " }", "}"].join("\n"),
      a = this.config,
      n = a.styleConfig,
      i = a.animationConfig;
    this.cloudTexture = (new b.TextureLoader).load(window.appConfig.ASSETS_URL + n.cloudImage),
      this.cloudTexture.wrapS = this.cloudTexture.wrapT = b.RepeatWrapping,
      this.cloudMaterial = new b.ShaderMaterial({
        uniforms: {
          division: {
            type: "f",
            value: Math.sqrt(n.radius * n.radius - 1e6) / n.radius
          },
          coeficient: {
            type: "f",
            value: .002
          },
          time: {
            type: "f",
            value: 0
          },
          opacity: {
            type: "f",
            value: n.opacity
          },
          xSpeed: {
            type: "f",
            value: i.xSpeed
          },
          ySpeed: {
            type: "f",
            value: i.ySpeed
          },
          number: {
            type: "f",
            value: n.number
          },
          color: {
            type: "c",
            value: (new b.Color).setStyle(n.color.toLocaleLowerCase())
          },
          cloudTexture: {
            type: "f",
            value: this.cloudTexture
          }
        },
        blending: b.AdditiveBlending,
        vertexShader: e,
        fragmentShader: t,
        transparent: !0,
        depthTest: !1
      })
  }
  showData() {
    var e = this.config,
      t = e.styleConfig,
      a = (e.animationConfig,
        new b.SphereGeometry(t.radius, 64, 64));
    this.cloud = new b.Mesh(a, this.cloudMaterial),
      this.showGroup.add(this.cloud)
  }
  update() {
    this.cloudMaterial && (this.cloudMaterial.uniforms.time.value = this.cloudMaterial.uniforms.time.value + 1)
  }
  updateComponent(e) {
    var t = this.config;
    if (this.config = e.configuration.technologyCloud, !Object(w.isEqual)(t, this.config)) {
      var a = this.config,
        n = a.styleConfig,
        i = a.animationConfig;
      this.cloudMaterial.uniforms.opacity.value = n.opacity,
        this.cloudMaterial.uniforms.number.value = n.number,
        this.cloudMaterial.uniforms.xSpeed.value = i.xSpeed,
        this.cloudMaterial.uniforms.ySpeed.value = i.ySpeed,
        this.cloudMaterial.uniforms.color.value = (new b.Color).setStyle(n.color.toLocaleLowerCase()),
        n.radius !== t.styleConfig.radius && (this.cloudMaterial.uniforms.division.value = Math.sqrt(n.radius * n.radius - 1e6) / n.radius,
          this.showGroup.remove(this.cloud),
          this.cloud && this.cloud.geometry && (this.cloud.geometry.dispose(),
            this.cloud.geometry = null),
          this.cloud = null,
          this.showData())
    }
  }
  destroy() {
    this.otherGroup.remove(this.showGroup),
      this.showGroup.remove(this.cloud),
      this.cloud && this.cloud.geometry && (this.cloud.geometry.dispose(),
        this.cloud.geometry = null),
      this.cloud = null,
      this.cloudMaterial && (this.cloudMaterial.dispose(),
        this.cloudMaterial = null),
      this.cloudTexture && (this.cloudTexture.dispose(),
        this.cloudTexture = null)
  }
}

class satellite {
  constructor(e, n) {
    this.config = e.configuration.satellite
    i.otherGroup = n.otherGroup
    i.showGroup = new b.Group
    i.otherGroup.add(i.showGroup)
    i.rotateGroup = new b.Group
    i.showGroup.add(i.rotateGroup)
    i.rotateSpeed = i.config.satelliteConfig.rotateSpeed
    i.initSatelliteMaterial()
    i.showSatellite()
    i.initLineMaterial()
    i.showLine()
  }
  initLineMaterial() {
    var e = this.config.orbitalConfig;
    e.show && (this.lineMaterial = new b.LineBasicMaterial({
      color: (new b.Color).setStyle(e.color.toLocaleLowerCase()),
      transparent: !!e.opacity,
      opacity: e.opacity
    }))
  }
  initSatelliteMaterial() {
    var e = this.config.satelliteConfig;
    this.satelliteMaterial = new b.MeshBasicMaterial({
      color: (new b.Color).setStyle(e.color.toLocaleLowerCase()),
      transparent: !!e.opacity,
      opacity: e.opacity,
      wireframe: !0
    })
  }
  showSatellite() {
    var e = this,
      t = this.config,
      a = t.orbitalConfig,
      n = t.satelliteConfig,
      i = new b.OBJLoader;
    n.model && i.load(window.appConfig.ASSETS_URL + n.model, (function (t) {
      e.satellite = t,
        e.satellite.traverse((function (t) {
          t.isMesh && (t.material = e.satelliteMaterial)
        })),
        e.satellite.scale.x = e.satellite.scale.y = e.satellite.scale.z = n.scale,
        e.satellite.setRotationFromEuler(new b.Euler(n.rotateX / 180 * Math.PI, n.rotateY / 180 * Math.PI, n.rotateZ / 180 * Math.PI, "XYZ")),
        e.satellite.position.x = a.radius,
        e.rotateGroup.add(e.satellite)
    }))
  }
  showLine() {
    var e = this.config.orbitalConfig;
    if (e.show) {
      for (var t = [], a = 0; a <= 128; a++)
        t.push(Math.cos(a / 64 * Math.PI) * e.radius, Math.sin(a / 64 * Math.PI) * e.radius, 0);
      var n = new b.BufferGeometry;
      n.addAttribute("position", new b.Float32BufferAttribute(t, 3)),
        this.satelliteLine = new b.Line(n, this.lineMaterial),
        this.showGroup.add(this.satelliteLine)
    }
    this.showGroup.setRotationFromEuler(new b.Euler(e.rotateX / 180 * Math.PI, e.rotateY / 180 * Math.PI, e.rotateZ / 180 * Math.PI, "XYZ"))
  }
  update() {
    this.rotateSpeed && this.rotateGroup && this.rotateGroup.rotateZ(8e-4 * this.rotateSpeed)
  }
  updateComponent(e) {
    var t = this.config,
      a = t.orbitalConfig,
      n = t.satelliteConfig;
    this.config = e.configuration.satellite;
    var i = this.config,
      r = i.orbitalConfig,
      o = i.satelliteConfig;
    Object(w.isEqual)(a, r) || (a.show && !r.show ? (this.destroyLine(),
      this.lineMaterial && (this.lineMaterial.dispose(),
        this.lineMaterial = null)) : a.show && r.show ? (this.lineMaterial.color = (new b.Color).setStyle(r.color.toLocaleLowerCase()),
          this.lineMaterial.opacity = r.opacity,
          a.radius !== r.radius ? (this.destroyLine(),
            this.showLine(),
            this.satellite.position.x = r.radius) : this.showGroup.setRotationFromEuler(new b.Euler(r.rotateX / 180 * Math.PI, r.rotateY / 180 * Math.PI, r.rotateZ / 180 * Math.PI, "XYZ"))) : !a.show && r.show && (this.initLineMaterial(),
              this.showLine())),
      Object(w.isEqual)(n, o) || (this.satelliteMaterial.color = (new b.Color).setStyle(o.color.toLocaleLowerCase()),
        this.satelliteMaterial.opacity = r.opacity,
        this.rotateSpeed = o.rotateSpeed,
        n.model !== o.model ? (this.destroySatellite(),
          this.showSatellite()) : (this.satellite.scale.x = this.satellite.scale.y = this.satellite.scale.z = o.scale,
            this.satellite.setRotationFromEuler(new b.Euler(o.rotateX / 180 * Math.PI, o.rotateY / 180 * Math.PI, o.rotateZ / 180 * Math.PI, "XYZ"))))
  }
  destroySatellite() {
    if (this.rotateGroup.remove(this.satellite),
      this.satellite) {
      var e, t = r(this.satellite.children);
      try {
        for (t.s(); !(e = t.n()).done;) {
          var a = e.value;
          a && a.geometry && a.geometry.dispose()
        }
      } catch (e) {
        t.e(e)
      } finally {
        t.f()
      }
      this.satellite = null
    }
  }
  destroyLine() {
    this.showGroup.remove(this.satelliteLine),
      this.satelliteLine && this.satelliteLine.geometry.dispose()
  }
  destroy() {
    this.destroySatellite(),
      this.destroyLine(),
      this.showGroup.remove(this.rotateGroup),
      this.rotateGroup = null,
      this.rotateSpeed = null,
      this.lineMaterial && (this.lineMaterial.dispose(),
        this.lineMaterial = null),
      this.satelliteMaterial && (this.satelliteMaterial.dispose(),
        this.satelliteMaterial = null)
  }
}

class flyLine {
  ta = ["#include <logdepthbuf_pars_vertex>", "varying vec2 vUv;", "void main(){", " vUv = uv;", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", " #include <logdepthbuf_vertex>", "}"].join("\n")
  aa = ["#include <logdepthbuf_pars_fragment>", "varying vec2 vUv;", "uniform float time;", "uniform float offset;", "uniform bool lineShow;", "uniform vec3 lineColor;", "uniform float lineOpacity;", "uniform vec3 startColor;", "uniform float startOpacity;", "uniform vec3 endColor;", "uniform float endOpacity;", "uniform float lineLength;", "void main(){", " #include <logdepthbuf_fragment>", " float start = time * 0.0005 + offset;", " start = fract(start) * (1.0 + lineLength) - lineLength;", " float end = start + lineLength;", " float offset = end - vUv.x;", " if(offset < 0.0 || offset > lineLength) {", "  if(lineShow) {", "   gl_FragColor = vec4(lineColor, lineOpacity);", "  } else {", "   discard;", "  }", " } else {", "  float intensity = 1.0;", "  intensity = 1.0 - abs(offset / lineLength);", "  gl_FragColor = vec4(vec3(mix(endColor, startColor, intensity)), mix(endOpacity, startOpacity, intensity));", " }", "}"].join("\n")
  constructor() {
    i.earthGroup = n.earthGroup
    i.id = e.id
    i.config = e.configuration.flyLine
    i.interaction = e.configuration.interaction
    i.showGroup = new b.Group
    i.labelGroup = new b.Group
    i.circlePlane = new b.Group
    i.earthGroup.add(i.showGroup, i.labelGroup, i.circlePlane)
    i.data = e.data
    i.timers = []
    i.keyframes = []
    i.showData()
  }
  showData() {
    var e = this.config,
      t = e.styleConfig,
      a = e.animationConfig,
      n = e.bubbleConfig;
    if (this.data && this.data.length > 0) {
      var i, o = r(this.data);
      try {
        for (o.s(); !(i = o.n()).done;) {
          var s = i.value,
            l = a.startRandom ? Math.random() * Math.random() * 10 : 0,
            u = new b.ShaderMaterial({
              uniforms: {
                time: {
                  type: "f",
                  value: 0
                },
                offset: {
                  type: "f",
                  value: l
                },
                lineShow: {
                  value: !!t.lineConfig.opacity && t.lineConfig.show
                },
                lineColor: {
                  value: (new b.Color).setStyle(t.lineConfig.color.toLocaleLowerCase())
                },
                lineOpacity: {
                  value: t.lineConfig.opacity
                },
                startColor: {
                  value: (new b.Color).setStyle(t.startColor.toLocaleLowerCase())
                },
                startOpacity: {
                  value: t.startOpacity
                },
                endColor: {
                  value: (new b.Color).setStyle(t.endColor.toLocaleLowerCase())
                },
                endOpacity: {
                  value: t.endOpacity
                },
                lineLength: {
                  value: t.lineLength
                }
              },
              vertexShader: ta,
              fragmentShader: aa,
              transparent: !0
            }),
            c = s.startLng,
            h = s.startLat,
            p = s.endLng,
            d = s.endLat,
            m = s.endText,
            f = c < 0 ? c + 360 : c,
            g = p < 0 ? p + 360 : p,
            v = new b.Vector2(Number(f), Number(h)),
            y = new b.Vector2(Number(g), Number(d)),
            _ = v.clone().lerp(y, .35),
            w = v.clone().lerp(y, .65),
            M = N(f, h, 1e3),
            x = N(g, d, 1e3),
            C = (new b.Vector3).addVectors(M, x).multiplyScalar(.5),
            S = M.distanceTo(x),
            L = C.distanceTo(new b.Vector3(0, 0, 0)),
            A = 3 * S / 10,
            G = (4e3 + 4 * t.lineHeight - L) / 3,
            D = Math.sqrt(A * A + G * G),
            k = N(_.x, _.y, D),
            P = N(w.x, w.y, D),
            R = new b.CubicBezierCurve3(M, k, P, x),
            O = new b.TubeBufferGeometry(R, 50, t.lineWidth, 3, !1),
            I = new b.Mesh(O, u);
          if (I.userData = B({}, s),
            t.headIcon.show) {
            I.userData.curveLine = R;
            var j = this.initFlyLineIcon(M.clone(), x.clone(), t.headIcon.url, t.headIcon.iconWidth, t.headIcon.iconHeight);
            I.add(j),
              I.userData.icon = j
          }
          if (I.renderOrder = 10,
            I.interactive = !0,
            I.componentId = this.id,
            this.showGroup.add(I),
            m && n.show) {
            var F = n.textConfig,
              U = n.backConfig,
              z = U.width,
              V = U.height,
              q = U.positionHeight,
              H = U.scale,
              Y = U.basePosition,
              $ = z / V,
              X = E(m, F, U),
              W = new b.SpriteMaterial({
                transparent: !0
              });
            W.map = new b.Texture(X),
              W.map.anisotropy = 16,
              W.map.needsUpdate = !0;
            var K = new b.Sprite(W),
              Z = N(g, d, 1e3 + q);
            K.position.copy(Z),
              K.center = new b.Vector2(Y.x, Y.y),
              K.scale.set(H, H / $, 1),
              this.labelGroup.add(K)
          }
          if (t.circlePlaneConfig.show) {
            var J = N(g, d, 1e3),
              Q = new b.PlaneGeometry(t.circlePlaneConfig.circleRadius, t.circlePlaneConfig.circleRadius, 10, 10),
              ee = new b.ShaderMaterial({
                uniforms: {
                  time: {
                    type: "f",
                    value: 0
                  },
                  opacity: {
                    value: Object(T.rgb)(t.circlePlaneConfig.circleColor.toLocaleLowerCase()).opacity
                  },
                  color: {
                    value: (new b.Color).setStyle(t.circlePlaneConfig.circleColor.toLocaleLowerCase())
                  }
                },
                vertexShader: "\n  varying vec2 vUv;\n  void main(){\n    vUv = uv;\n    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n  }\n",
                fragmentShader: "\n  varying vec2 vUv;\n  uniform float time;\n  uniform float opacity;\n  uniform vec3 color;\n  void main(){\n    float w = 0.4;\n    float r = distance(vec2(0.5), vUv);\n    float calR = 0.5*time;\n    if(r > calR-0.2 && r < calR) {\n        if(r > 0.5 - 0.2) {\n          discard;\n        }else {\n          float a = (r - (calR-0.2))/0.2;\n          gl_FragColor = vec4(color, a * opacity);\n        }\n    }else {\n      discard;\n    }\n  }\n",
                transparent: !0,
                side: b.BackSide,
                depthWrite: !1,
                depthTest: !1
              }),
              te = new b.Mesh(Q, ee);
            te.position.copy(J),
              te.lookAt(0, 0, 0),
              this.adjustVertor(Q, 1e3),
              I.add(te),
              I.userData.circlePlane = te
          }
        }
      } catch (e) {
        o.e(e)
      } finally {
        o.f()
      }
    }
  }
  adjustVertor(e, t) {
    e.vertices.forEach((function (e) {
      var a = e.length(),
        n = Math.sqrt(a * a + t * t),
        i = t * (n - t) / n;
      e.z = i
    })),
      e.verticesNeedUpdate = !0
  }
  initFlyLineIcon(e, t, a, n, i) {
    !this.textureLoader && (this.textureLoader = new b.TextureLoader);
    var r = new b.Group,
      o = new b.PlaneBufferGeometry(n, i),
      s = new b.MeshBasicMaterial({
        map: this.textureLoader.load(window.appConfig.ASSETS_URL + a),
        side: b.DoubleSide,
        transparent: !0,
        depthWrite: !1
      }),
      l = new b.Mesh(o, s);
    return l.rotation.y = Math.PI,
      l.rotation.x = Math.PI / 2,
      r.userData.plane = l,
      r.up = e.add(t).divideScalar(2).normalize(),
      r.add(l),
      r
  }
  getSupportObjects() {
    return this.showGroup
  }
  updateComponent(e) {
    var t = this.config,
      a = this.data;
    this.config = e.configuration.flyLine,
      this.data = e.data,
      Object(w.isEqual)(t, this.config) && Object(w.isEqual)(a, this.data) || (this.destroyAnimate(),
        this.destroyLine(),
        this.destroyLabel(),
        this.showData())
  }
  destroyLine() {
    var e, t = r(this.showGroup.children);
    try {
      for (t.s(); !(e = t.n()).done;) {
        var a = e.value;
        if (a && a.geometry && a.geometry.dispose(),
          a.geometry = null,
          a && a.material && a.material.dispose(),
          a.material = null,
          a.userData.icon) {
          var n = a.userData.icon.userData.plane;
          n.geometry.dispose(),
            n.material.dispose(),
            a.userData.icon.remove(n),
            a.remove(a.userData.icon),
            a.userData.icon = null
        }
        if (a.userData.circlePlane) {
          var i = a.userData.circlePlane;
          i.geometry.dispose(),
            i.material.dispose(),
            a.remove(i),
            a.userData.circlePlane = null
        }
      }
    } catch (e) {
      t.e(e)
    } finally {
      t.f()
    }
    this.showGroup.children.length = 0,
      this.showGroup.children = []
  }
  destroyLabel() {
    this.labelGroup.children.map((function (e) {
      e.material && (e.material.map = null,
        e.material.dispose()),
        e.geometry && e.geometry.dispose(),
        e.material = null,
        e.geometry = null
    })),
      this.labelGroup.children = []
  }
  destroyAnimate() {
    this.timers && (this.timers.forEach((function (e) {
      return clearTimeout(e)
    })),
      this.timers = []),
      this.keyframes && (this.keyframes.forEach((function (e) {
        return e.stop()
      })),
        this.keyframes = [])
  }
  update() {
    if (this.config.animationConfig.speed) {
      var e, t = r(this.showGroup.children);
      try {
        for (t.s(); !(e = t.n()).done;) {
          var a = e.value;
          if (a && a.material) {
            var n = a.material.uniforms.offset.value,
              i = a.material.uniforms.lineLength.value,
              o = a.material.uniforms.time.value + this.config.animationConfig.speed;
            a.material.uniforms.time.value = o;
            var s = 5e-4 * o + n;
            if (s = (s - Math.floor(s)) * (1 + i),
              a.userData.circlePlane) {
              var l = a.userData.circlePlane.material,
                u = s;
              u > 1 && u < 1 + i && (l.uniforms.time.value = (u - 1) / i)
            }
            if (this.config.styleConfig.headIcon.show) {
              var c = a.userData.curveLine.getPointAt(s, new b.Vector3);
              a.userData.icon.position.copy(c),
                a.userData.icon.userData.plane.material.opacity = s > .8 ? (1 - s) / .2 : s < .2 ? s / .2 : 1;
              var h = a.userData.curveLine.getPointAt(s + .02, new b.Vector3);
              a.userData.icon.lookAt(h.applyMatrix4(this.showGroup.matrixWorld))
            }
          }
        }
      } catch (e) {
        t.e(e)
      } finally {
        t.f()
      }
    }
  }
  destroy() {
    this.destroyAnimate(),
      this.destroyLabel(),
      this.destroyLine(),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null,
      this.data = null,
      this.config = null
  }
}

class pointMark {
  constructor(e, n) {
    this.config = e.configuration.pointMark,
      i.data = e.data,
      i.earthGroup = n.earthGroup,
      i.showGroup = new b.Group,
      i.earthGroup.add(i.showGroup),
      i.initMaterial(),
      i.showData(),
      i
  }
  initMaterial() {
    var e = this.config.baseConfig,
      t = e.mix;
    this.textureLoader || (this.textureLoader = new b.TextureLoader),
      this.shaderMaterial && (this.shaderMaterial.dispose(),
        this.ShaderMaterial = null);
    var a = ["varying vec2 vUv;", "void main() {", "  vUv = uv;", "  gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4( position, 1.0 );", "}"].join("\n"),
      n = ["varying vec2 vUv;", "uniform vec3 color;", "uniform sampler2D texture;", "void main() {", "  vec4 textureColor = texture2D( texture, vUv );", "  if ( textureColor.a < 0.0001 ) discard;", "  gl_FragColor = vec4(color, (textureColor.r + textureColor.g + textureColor.b) / 3.0);", "}"].join("\n");
    this.shaderMaterial = new b.ShaderMaterial({
      uniforms: {
        color: {
          value: (new b.Color).setStyle(t.color.toLocaleLowerCase())
        },
        texture: {
          value: this.textureLoader.load(window.appConfig.ASSETS_URL + e.pointImage)
        }
      },
      side: b.BackSide,
      vertexShader: a,
      fragmentShader: t.show ? n : "\n      uniform sampler2D texture;\n      varying vec2 vUv;\n\n      void main( void ) {\n        vec4 tColor = texture2D(texture, vUv);\n        gl_FragColor = tColor;      \n      }\n    ",
      depthTest: !1,
      transparent: !0
    })
  }
  showData() {
    var e = this.config.baseConfig;
    this.destroyPoint();
    var t, a = r(this.data);
    try {
      for (a.s(); !(t = a.n()).done;) {
        var n = t.value,
          i = L(n.lng, n.lat, 1001),
          o = new b.Mesh(new b.PlaneBufferGeometry(e.size, e.size, 1, 1), this.shaderMaterial);
        o.position.set(i[0], i[1], i[2]),
          o.lookAt(new b.Vector3(0, 0, 0)),
          this.showGroup.add(o)
      }
    } catch (e) {
      a.e(e)
    } finally {
      a.f()
    }
  }
  updateComponent(e) {
    var t = this.config.baseConfig,
      a = this.data;
    this.config = e.configuration.pointMark,
      this.data = e.data;
    var n = this.config.baseConfig;
    if (!Object(w.isEqual)(t, n)) {
      this.initMaterial();
      var i, o = r(this.showGroup.children);
      try {
        for (o.s(); !(i = o.n()).done;) {
          i.value.material = this.shaderMaterial
        }
      } catch (e) {
        o.e(e)
      } finally {
        o.f()
      }
    }
    Object(w.isEqual)(a, this.data) && t.size === n.size || (this.destroyPoint(),
      this.showData())
  }
  destroyPoint() {
    var e, t = r(this.showGroup.children);
    try {
      for (t.s(); !(e = t.n()).done;) {
        var a = e.value;
        a.geometry && a.geometry.dispose(),
          a.geometry = null
      }
    } catch (e) {
      t.e(e)
    } finally {
      t.f()
    }
    this.showGroup.children.length = 0,
      this.showGroup.children = []
  }
  destroy() {
    this.data = null,
      this.textureLoader = null,
      this.texture && (this.texture.dispose(),
        this.texture = null),
      this.shaderMaterial && (this.shaderMaterial.dispose(),
        this.ShaderMaterial = null),
      this.destroyPoint(),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null
  }
}

class nameBubble {
  constructor(e, n) {
    this.earthGroup = n.earthGroup,
      i.earthCamera = n.earthCamera,
      i.config = e.configuration.nameBubble,
      i.data = e.data,
      i.showGroup = new b.Group,
      i.earthGroup.add(i.showGroup),
      i.showData()
  }
  showData() {
    var e, t = this.config.bubbleConfig,
      a = t.renderOrder,
      n = (t.width,
        t.height),
      i = t.scale,
      o = t.basePosition,
      s = t.positionHeight,
      l = r(this.data);
    try {
      for (l.s(); !(e = l.n()).done;) {
        var u = e.value,
          c = this.drawCanvas(u.name),
          h = c.drawingCanvas,
          p = c.calWidth / n,
          d = new b.SpriteMaterial({
            transparent: !0,
            depthTest: !1
          });
        d.map = new b.Texture(h),
          d.map.anisotropy = 16,
          d.map.needsUpdate = !0;
        var m = L(u.lng, u.lat, 1e3 + s),
          f = new b.Sprite(d);
        f.center = new b.Vector2(o.x, o.y),
          f.position.set(m[0], m[1], m[2]),
          f.scale.set(i * p, i, 1),
          f.renderOrder = a,
          this.showGroup.add(f)
      }
    } catch (e) {
      l.e(e)
    } finally {
      l.f()
    }
  }
  drawCanvas(e) {
    var t = this.config,
      a = t.bubbleConfig,
      n = t.nameConfig,
      i = a.width,
      r = a.height,
      o = (a.scale,
        a.topDecorate),
      s = document.createElement("canvas");
    s.setAttribute("width", i),
      s.setAttribute("height", r);
    var l = s.getContext("2d");
    l.font = "normal ".concat(n.fontSize, "px ").concat(n.fontFamily),
      l.fillStyle = n.color,
      l.textAlign = "center",
      l.textBaseline = "middle";
    var u = i * (l.measureText(e).width / i) + 64;
    s.setAttribute("width", u),
      l.fillStyle = a.color,
      l.fillRect(0, 0, u, r);
    var c = 0;
    return o.show && (l.fillStyle = o.color,
      l.fillRect(0, 0, u, o.height),
      c = o.height),
      l.font = "normal ".concat(n.fontSize, "px ").concat(n.fontFamily),
      l.fillStyle = n.color,
      l.textAlign = "center",
      l.textBaseline = "middle",
      l.fillText(e, u / 2, c + (r - c) / 2), {
      drawingCanvas: s,
      calWidth: u
    }
  }
  update() {
    var e = this;
    this.showGroup.children.map((function (t) {
      var a = t.position.clone();
      a.applyMatrix4(e.showGroup.matrixWorld),
        a.distanceTo(e.earthCamera.position) > e.earthCamera.position.length() ? t.visible = !1 : t.visible = !0
    }))
  }
  updateComponent(e) {
    var t = this.config,
      a = this.data;
    this.config = e.configuration.nameBubble,
      this.data = e.data,
      Object(w.isEqual)(t, this.config) && Object(w.isEqual)(a, this.data) || (this.destroyBubble(),
        this.showData())
  }
  destroyBubble() {
    var e, t = r(this.showGroup.children);
    try {
      for (t.s(); !(e = t.n()).done;) {
        var a = e.value;
        a.material && (a.material.map && a.material.map.dispose(),
          a.material.dispose()),
          a = null
      }
    } catch (e) {
      t.e(e)
    } finally {
      t.f()
    }
    this.showGroup.children.length = 0,
      this.showGroup.children = []
  }
  destroy() {
    this.destroyBubble(),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null,
      this.data = null,
      this.config = null
  }
}

class movingStars {
  constructor(e, n) {
    this.config = e.configuration.movingStars,
      i.data = e.data,
      i.otherGroup = n.otherGroup,
      i.earthCamera = n.earthCamera,
      i.showGroup = new b.Group,
      i.otherGroup.add(i.showGroup),
      i.initMaterial(),
      i.showData(),
      i
  }
  initMaterial() {
    var e = ["attribute float size;", "void main() {", "  vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);", "  gl_PointSize = size * (300.0 / -mvPosition.z);", "  gl_Position = projectionMatrix * mvPosition;", "}"].join("\n"),
      t = ["uniform vec3 color;", "uniform float opacity;", "void main() {", "  gl_FragColor = vec4( color, opacity );", "}"].join("\n");
    this.material = new b.ShaderMaterial({
      uniforms: {
        color: {
          value: (new b.Color).setStyle(this.config.baseConfig.color.toLocaleLowerCase())
        },
        opacity: {
          value: this.config.baseConfig.opacity
        }
      },
      vertexShader: e,
      fragmentShader: t,
      transparent: !0
    })
  }
  showData() {
    for (var e = this.config.baseConfig, t = (e.color,
      e.maxSize), a = e.minSize, n = e.number, i = e.encircleInRadius, r = e.encircleOutRadius, o = Math.floor(n / 2), s = n - o, l = new Float32Array(s), u = new Float32Array(3 * s), c = new Float32Array(o), h = new Float32Array(3 * o), p = 0; p < s;) {
      var d = this._getRandomPosition(i, r);
      u[3 * p + 0] = d.x,
        u[3 * p + 1] = d.y,
        u[3 * p + 2] = d.z,
        l[p] = a + (t - a) * Math.random(),
        p++
    }
    var m = new b.BufferGeometry;
    for (m.addAttribute("position", new b.BufferAttribute(u, 3)),
      m.addAttribute("size", new b.BufferAttribute(l, 1)),
      this.particlesRight = new b.Points(m, this.material),
      this.showGroup.add(this.particlesRight),
      p = 0; p < o;) {
      var f = this._getRandomPosition(i, r);
      h[3 * p + 0] = f.x,
        h[3 * p + 1] = f.y,
        h[3 * p + 2] = f.z,
        c[p] = a + (t - a) * Math.random(),
        p++
    }
    var g = new b.BufferGeometry;
    g.addAttribute("position", new b.BufferAttribute(h, 3)),
      g.addAttribute("size", new b.BufferAttribute(c, 1)),
      this.particlesLeft = new b.Points(g, this.material),
      this.showGroup.add(this.particlesLeft)
  }
  _getRandomPosition(e, t) {
    var a = new b.Vector3(Math.random() - .5, Math.random() - .5, Math.random() - .5);
    return a.normalize(),
      a.multiplyScalar(e + (t - e) * Math.random())
  }
  updateComponent(e) {
    var t = this.config.baseConfig,
      a = this.data;
    this.config = e.configuration.movingStars;
    var n = this.config.baseConfig;
    this.data = e.data,
      Object(w.isEqual)(a, this.data) && t.encircleInRadius === n.encircleInRadius && t.encircleOutRadius === n.encircleOutRadius && t.maxSize === n.maxSize && t.minSize === n.minSize && t.number === n.number || (this.destroyPoint(),
        this.showData()),
      t.color === n.color && t.opacity === n.opacity || (this.material.uniforms.color.value = (new b.Color).setStyle(n.color.toLocaleLowerCase()),
        this.material.uniforms.opacity.value = n.opacity)
  }
  update() {
    var e = this.config.baseConfig.rotateSpeed;
    e && this.particlesRight && this.particlesRight.rotateY(1e-5 * e),
      e && this.particlesLeft && this.particlesLeft.rotateY(-1e-5 * e)
  }
  destroyPoint() {
    this.particlesRight && this.particlesRight.geometry && (this.showGroup.remove(this.particlesRight),
      this.particlesRight.geometry.dispose(),
      this.particlesRight = null),
      this.particlesLeft && this.particlesLeft.geometry && (this.showGroup.remove(this.particlesLeft),
        this.particlesLeft.geometry.dispose(),
        this.particlesLeft = null)
  }
  destroy() {
    this.destroyPoint(),
      this.otherGroup.remove(this.showGroup),
      this.showGroup = null,
      this.material && (this.material.dispose(),
        this.material = null),
      this.data = null,
      this.config = null
  }
}

class surfaceLine {
  ha = ["#include <logdepthbuf_pars_vertex>", "varying vec2 vUv;", "void main(){", " vUv = uv;", " gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);", " #include <logdepthbuf_vertex>", "}"].join("\n")
  pa = ["#include <logdepthbuf_pars_fragment>", "varying vec2 vUv;", "uniform float time;", "uniform float count;", "uniform sampler2D texture;", "void main(){", " #include <logdepthbuf_fragment>", "  gl_FragColor = texture2D( texture, vec2(fract(vUv.x*count + time), fract(vUv.y*2.0 - 0.2)) );", "}"].join("\n")
  constructor() {
    i.earthGroup = n.earthGroup,
      i.config = e.configuration.surfaceLine,
      i.showGroup = new b.Group,
      i.id = e.id,
      i.interaction = e.configuration.interaction,
      i.earthGroup.add(i.showGroup),
      i.data = e.data,
      i.showData()
  }
  getSupportObjects() {
    return this.showGroup
  }
  showData() {
    var e = this,
      t = this.config.styleConfig;
    if (this.data && this.data.length > 0 && t.lineTextureConfig.show && t.lineTextureConfig.lineTexture) {
      var a = window.appConfig.ASSETS_URL + t.lineTextureConfig.lineTexture;
      !this.textureLoader && (this.textureLoader = new b.TextureLoader);
      for (var n = 0; n < this.data.length; n++) {
        var i = this.data[n].geometry && "LineString" === this.data[n].geometry.type && this.data[n].geometry.coordinates;
        i && i.length >= 2 && function () {
          for (var n = [], r = 0; r < i.length; r++)
            if (0 == r) {
              var o = i[r],
                s = N(o[0], o[1], 1e3);
              n.push(s)
            } else if (r > 0)
              for (var l = i[r], u = i[r - 1], c = N(l[0], l[1], 1e3), h = N(u[0], u[1], 1e3), p = e.calSurfacePoints(h, c), d = 0; d < p.length; d++)
                n.push(p[d]);
          var m = new b.CatmullRomCurve3(n),
            f = new b.TubeBufferGeometry(m, 5 * n.length, t.lineTextureConfig.lineWidth, 8, !1),
            g = new b.ShaderMaterial({
              uniforms: {
                time: {
                  value: 0
                },
                count: {
                  value: m.getLength() / t.lineTextureConfig.repeatLength
                },
                texture: {
                  value: e.textureLoader.load(a)
                }
              },
              vertexShader: ha,
              fragmentShader: pa,
              transparent: !0
            }),
            v = new b.Mesh(f, g);
          if (v.userData.curveLine = m,
            v.interactive = !0,
            v.componentId = e.id,
            e.showGroup.add(v),
            "image" == t.iconType) {
            if (t.lineIconConfig.show && t.lineIconConfig.lineIcon) {
              var y = window.appConfig.ASSETS_URL + t.lineIconConfig.lineIcon,
                _ = e.initSurfaceLineIcon(y, t.lineIconConfig.iconWidth, t.lineIconConfig.iconHeight);
              _.renderOrder = 1,
                v.userData.icon = _,
                v.add(_)
            }
          } else if (t.modelIconConfig.show && t.lineIconConfig.lineIcon) {
            var w = window.appConfig.ASSETS_URL + t.modelIconConfig.modelURL;
            e.initSurfaceLineModel(w, (function (e) {
              e.renderOrder = 1,
                v.userData.icon = e,
                v.add(e)
            }))
          }
        }()
      }
    }
  }
  initSurfaceLineModel(e, t) {
    !this.loader && (this.loader = new b.GLTFLoader),
      this.loader.load(e, (function (e) {
        var a = e.scene;
        a.scale.set(.5, .5, .5),
          a.traverse((function (e) {
            e.material && (e.material.transparent = !0)
          })),
          t(a)
      }))
  }
  initSurfaceLineIcon(e, t, a) {
    !this.textureLoader && (this.textureLoader = new b.TextureLoader);
    var n = new b.Sprite(new b.SpriteMaterial({
      map: this.textureLoader.load(e),
      transparent: !0,
      depthTest: !1
    }));
    return n.scale.set(t, a, 1),
      n
  }
  calSurfacePoints(e, t) {
    for (var a = Math.PI / 128, n = e.angleTo(t), i = n < a ? 0 : n / a, r = 1 / i, o = 0, s = [], l = 1; l < i; l++) {
      var u = e.clone().lerp(t.clone(), o).normalize();
      u.normalize(),
        u.multiplyScalar(1e3),
        s.push(u),
        o += r
    }
    return s.push(t),
      s
  }
  updateComponent(e) {
    var t = this.config,
      a = this.data;
    this.config = e.configuration.surfaceLine,
      this.data = e.data,
      Object(w.isEqual)(t, this.config) && Object(w.isEqual)(a, this.data) || (this.disposeSurfaceLines(t.styleConfig.iconType),
        this.showData())
  }
  disposeSurfaceLines(e) {
    for (; this.showGroup.children.length > 0;) {
      var t = this.showGroup.children[0],
        a = t.userData.icon;
      a && ("image" === e ? (a.geometry.dispose(),
        a.material.dispose(),
        t.remove(a)) : (Object(S.deepDispose)(a),
          t.remove(a))),
        t.geometry.dispose(),
        t.material.dispose(),
        this.showGroup.remove(t)
    }
  }
  update() {
    var e = this;
    this.showGroup.children.map((function (t) {
      if (t.material.uniforms.time.value += (2 * Number(e.config.animationConfig.isOpposite) - 1) * e.config.animationConfig.speed / 1e3,
        e.config.styleConfig.lineIconConfig.show && t.userData.icon) {
        var a = e.config.animationConfig.ratio,
          n = t.material.uniforms.count.value,
          i = t.material.uniforms.time.value / n,
          r = i - Math.floor(i),
          o = t.userData.curveLine.getPointAt(1 - r, new b.Vector3),
          s = t.userData.icon;
        if (s)
          if (s.position.copy(o),
            "image" === e.config.styleConfig.iconType)
            s.material.opacity = r > 1 - a ? (1 - r) / a : r < a ? r / a : 1;
          else {
            var l = e.config.styleConfig.modelIconConfig,
              u = l.modelScale,
              c = l.rotateStep;
            if (s.up = o.clone().applyMatrix4(e.showGroup.matrixWorld.clone()).normalize(),
              1 - r + c > 0 && 1 - r + c < 1) {
              var h = t.userData.curveLine.getPointAt(1 - r + c, new b.Vector3);
              s.lookAt(h.applyMatrix4(e.showGroup.matrixWorld.clone()))
            }
            if (r > 1 - a) {
              var p = (1 - r) / a;
              s.scale.set(p * u, p * u, p * u),
                s.traverse((function (e) {
                  e.material && (e.material.opacity = p)
                }))
            } else if (r < a) {
              var d = r / a;
              s.scale.set(d * u, d * u, d * u),
                s.traverse((function (e) {
                  e.material && (e.material.opacity = d)
                }))
            } else {
              s.scale.set(1 * u, 1 * u, 1 * u),
                s.traverse((function (e) {
                  e.material && (e.material.opacity = 1)
                }))
            }
          }
      }
    }))
  }
  destroy() {
    this.disposeSurfaceLines(),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null,
      this.data = null,
      this.config = null
  }
}

class canvasPolygon {
  constructor(e, n) {
    this.earthGroup = n.earthGroup,
      i.config = e.configuration.canvasPolygon,
      i.data = e.data,
      i.showGroup = new b.Group,
      i.earthGroup.add(i.showGroup),
      i.width = 8192,
      i.height = i.width / 2,
      i.canvasDom = null,
      i.initMaterial(),
      i.showData(),
      i
  }
  initMaterial() {
    this.textureLoader || (this.textureLoader = new b.TextureLoader);
    this.config.baseConfig;
    this.canvasDom || (this.canvasDom = document.createElement("canvas"),
      this.canvasDom.setAttribute("width", this.width),
      this.canvasDom.setAttribute("height", this.height)),
      this.earthMaterial = new b.MeshBasicMaterial({
        map: new b.Texture(this.canvasDom),
        transparent: !0
      })
  }
  showData() {
    this.getData(),
      this.earth = new b.Mesh(new b.SphereGeometry(1001, 128, 128), this.earthMaterial),
      this.showGroup.add(this.earth)
  }
  getData() {
    var e = this;
    fetch(window.appConfig.ASSETS_URL + this.config.baseConfig.mapData).then((function (e) {
      return e.json()
    })).then((function (t) {
      e.mapData = t,
        e.drawCanvas()
    }))
  }
  formateDataAction() {
    var e = this;
    this.formateData = {},
      this.data.forEach((function (t) {
        t.name && !isNaN(Number(t.value)) && (e.formateData[t.name] = Number(t.value))
      }))
  }
  formateDataConfigAction() {
    var e = this,
      t = this.config.dataConfig;
    this.formateDataConfig = [],
      Object.keys(t).map((function (a) {
        var n = t[a],
          i = n.min,
          r = n.max,
          o = n.color;
        isNaN(i) || isNaN(r) || !o || e.formateDataConfig.push(n)
      }))
  }
  getStyleByValue(e) {
    var t = this.config.baseConfig.defaultFill.fillColor;
    if (isNaN(e))
      return t;
    for (var a = 0; a < this.formateDataConfig.length; a++) {
      var n = this.formateDataConfig[a];
      if (e >= n.min && e <= n.max) {
        t = n.color;
        break
      }
    }
    return t
  }
  drawCanvas() {
    var e = this;
    this.formateDataAction(),
      this.formateDataConfigAction();
    var t = this.config.baseConfig.defaultStroke,
      a = this.canvasDom.getContext("2d");
    a.clearRect(0, 0, this.width, this.height),
      this.mapData && this.mapData.features.forEach((function (n) {
        var i = n.geometry,
          r = i.coordinates,
          o = i.type,
          s = n.properties.name;
        a.strokeStyle = t.strokeStyle,
          a.lineWidth = t.lineWidth;
        var l = e.getStyleByValue(e.formateData[s]);
        a.fillStyle = l,
          "MultiPolygon" === o ? r.forEach((function (t) {
            t.forEach((function (t) {
              a.beginPath(),
                t.forEach((function (t) {
                  var n = (t[0] + 180) / 360 * e.width,
                    i = (90 - t[1]) / 180 * e.height;
                  a.lineTo(n, i)
                })),
                a.stroke()
            }))
          })) : "Polygon" === o && r.forEach((function (t) {
            a.beginPath(),
              t.forEach((function (t) {
                var n = (t[0] + 180) / 360 * e.width,
                  i = (90 - t[1]) / 180 * e.height;
                a.lineTo(n, i)
              })),
              a.stroke()
          })),
          "MultiPolygon" === o ? r.forEach((function (t) {
            t.forEach((function (t) {
              a.beginPath(),
                t.forEach((function (t) {
                  var n = (t[0] + 180) / 360 * e.width,
                    i = (90 - t[1]) / 180 * e.height;
                  a.lineTo(n, i)
                })),
                a.fill()
            }))
          })) : "Polygon" === o && r.forEach((function (t) {
            a.beginPath(),
              t.forEach((function (t) {
                var n = (t[0] + 180) / 360 * e.width,
                  i = (90 - t[1]) / 180 * e.height;
                a.lineTo(n, i)
              })),
              a.fill()
          }))
      })),
      this.earthMaterial.map.needsUpdate = !0,
      this.earthMaterial.needsUpdate = !0
  }
  updateComponent(e) {
    var t = this.config,
      a = t.baseConfig,
      n = t.dataConfig,
      i = this.data;
    this.config = e.configuration.canvasPolygon;
    var r = this.config,
      o = r.baseConfig,
      s = r.dataConfig;
    this.data = e.data,
      Object(w.isEqual)(a.mapData, o.mapData) ? Object(w.isEqual)(a.defaultStroke, o.defaultStroke) && Object(w.isEqual)(a.defaultFill, o.defaultFill) && Object(w.isEqual)(n, s) && Object(w.isEqual)(i, this.data) || this.drawCanvas() : this.getData()
  }
  destroy() {
    this.earthMaterial && (this.earthMaterial.dispose(),
      this.earthMaterial = null),
      this.earthMaterial && this.earthMaterial.map && (this.earthMaterial.map.dispose(),
        this.earthMaterial.map = null),
      this.earth && this.earth.geometry && (this.earth.geometry.dispose(),
        this.earth.geometry = null),
      this.earth = null,
      this.showGroup.remove(this.earth),
      this.earthGroup.remove(this.showGroup),
      this.showGroup = null,
      this.config = null,
      this.data = null,
      this.formateDataConfig = null,
      this.formateData = null,
      this.width = null,
      this.height = null,
      this.mapData = null
  }
}